
const createAction = function(method, api, mtype, istest) {
    return async function({ commit, state }, prames) {
        let res;
        let host = istest ? state.testAPIhost : state.APIhost
        if (method == 'gets') {
            res = await $$.gets(host + api);
            res && mtype && res.data && commit(mtype, res.data)
        } else if (method == "posts") {
            res = await $$.posts(host + api, prames);

            res && mtype && commit(mtype, res);
        }
        return res
    }
}
const store = new Vuex.Store({
    state: {
        count: 0,
        dd: 1
    },
    getters: {
        count(state) {
            return state.count
        }
    },
    mutations: {
        increment(state) {
            state.count++
        }
    }
});
export default store;